Tables [dbo].[CountryRef]
Properties
PropertyValue
Created10:31:19 AM Tuesday, March 02, 2010
Last Modified1:20:14 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_CountryRef: CountryCodeCountryCodenchar(2)4
No
Indexes AK_CountryRef_CountryName: CountryNameCountryNamenvarchar(50)100
No
Foreign Keys FK_CountryRef_AddressFormatRef: [dbo].[AddressFormatRef].AddressFormatKeyAddressFormatKeyuniqueidentifier16
No
VATCountryCodenvarchar(2)4
Yes
IntraStateCodenvarchar(2)4
Yes
IsActivebit1
No
IsHandModifiedbit1
No
MailGroupnvarchar(10)20
Yes
Indexes IX_CountryRef_DefaultShippingMethod: DefaultShippingMethodDefaultShippingMethodnvarchar(20)40
Yes
SyncCountryNamenvarchar(50)100
Yes
Foreign Keys FK_CountryRef_GroupMain_Chapter: [dbo].[GroupMain].ChapterGroupKeyIndexes IX_CountryRef_ChapterGroupKey: ChapterGroupKeyChapterGroupKeyuniqueidentifier16
Yes
Indexes IX_CountryRef_ISO3DigitCode: ISO3DigitCodeISO3DigitCodenchar(3)6
Yes
UpdatedOndatetime8
No
Foreign Keys FK_CountryRef_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_CountryRef_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
Indexes AK_CountryRef_CountryKey: CountryKeyCountryKeyuniqueidentifier16
No
(newid())
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_CountryRef: CountryCodePK_CountryRefCountryCode
Yes
AK_CountryRef_CountryKeyCountryKey
Yes
AK_CountryRef_CountryNameCountryName
Yes
IX_CountryRef_ChapterGroupKeyChapterGroupKey
IX_CountryRef_DefaultShippingMethodDefaultShippingMethod
IX_CountryRef_ISO3DigitCodeISO3DigitCode
IX_CountryRef_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_CountryRef_AddressFormatRefAddressFormatKey->[dbo].[AddressFormatRef].[AddressFormatKey]
FK_CountryRef_GroupMain_ChapterChapterGroupKey->[dbo].[GroupMain].[GroupKey]
FK_CountryRef_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
SQL Script
CREATE TABLE [dbo].[CountryRef]
(
[CountryCode] [nchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CountryName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AddressFormatKey] [uniqueidentifier] NOT NULL,
[VATCountryCode] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IntraStateCode] [nvarchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[IsActive] [bit] NOT NULL,
[IsHandModified] [bit] NOT NULL,
[MailGroup] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DefaultShippingMethod] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SyncCountryName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ChapterGroupKey] [uniqueidentifier] NULL,
[ISO3DigitCode] [nchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UpdatedOn] [datetime] NOT NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[CountryKey] [uniqueidentifier] NOT NULL CONSTRAINT [DF_CountryRef_CountryKey] DEFAULT (newid())
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [PK_CountryRef] PRIMARY KEY CLUSTERED ([CountryCode]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [AK_CountryRef_CountryKey] UNIQUE NONCLUSTERED ([CountryKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [AK_CountryRef_CountryName] UNIQUE NONCLUSTERED ([CountryName]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CountryRef_ChapterGroupKey] ON [dbo].[CountryRef] ([ChapterGroupKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CountryRef_DefaultShippingMethod] ON [dbo].[CountryRef] ([DefaultShippingMethod]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CountryRef_ISO3DigitCode] ON [dbo].[CountryRef] ([ISO3DigitCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_CountryRef_UpdatedByUserKey] ON [dbo].[CountryRef] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [FK_CountryRef_AddressFormatRef] FOREIGN KEY ([AddressFormatKey]) REFERENCES [dbo].[AddressFormatRef] ([AddressFormatKey])
GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [FK_CountryRef_GroupMain_Chapter] FOREIGN KEY ([ChapterGroupKey]) REFERENCES [dbo].[GroupMain] ([GroupKey])
GO
ALTER TABLE [dbo].[CountryRef] ADD CONSTRAINT [FK_CountryRef_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
Uses
Used By